//
//  YHIMUIKitHelper.h
//  YHChat
//
//  Created by 银河 on 2019/2/18.
//  Copyright © 2019 yinhe. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>

#import "YHIMUIKitDefine.h"

NS_ASSUME_NONNULL_BEGIN
@class YHIMUIKitConvCellData;

@class TIMMessage;
@class TIMConversation;

@interface YHIMUIKitHelper : NSObject

+ (YHIMUIKitConvCellData *)cellDataWithConv:(TIMConversation *)conv;

+ (int)unReadCountWith:(TIMConversation *)conv;
+ (NSString *)convIDWith:(TIMConversation *)conv;
+ (NSDate *)latestDateWith:(TIMConversation *)conv;
+ (YHIMUIKitConvType)convTypeWith:(TIMConversation *)conv;
+ (NSString *)titleForConv:(TIMConversation *)conv;
+ (NSString *)subTitleForConv:(TIMConversation *)conv;


// 消息时间转换
+ (NSString *)transformMessageDate:(NSDate *)date;


// 生成属性字符串的便捷方法.
+ (NSMutableAttributedString *)attributedStringWithText:(NSString *)text
                                                  color:(UIColor *)color
                                                   font:(UIFont *)font
                                                   kern:(CGFloat)kern
                                            lineSpacing:(CGFloat)lineSpacing
                                              alignment:(NSTextAlignment)alignment;

// 将聊天内容转换为属性字符串，内部匹配了表情，电话号码，URL
+ (NSMutableAttributedString *)getMessageAttributedStringWith:(NSString *)text;



@end

NS_ASSUME_NONNULL_END
